<?php

/*
 * This file is the jQuery for showing the attachment information.
 * 
 * Created by: Peter Agno Jr.
 * Date created: October 22, 2011
 */
?>

// Start function - Add document information 
            function addDocInfo(varAddInfoHere, varDocumentId, varPosition) { 
                jQuery.ajax({
                    type : 'POST',
                    url : 'ajaxRequests/addDocInfo.php',
                    dataType : 'json',
                    async : false,
                    data: {
                        documentId : varDocumentId,
                        scrnPostn : varPosition
                    },
                    success : function(data){
                       jQuery(varAddInfoHere).append(data.docInfo);
                    },
                    error : function() {
                        alert("Error in getting the document information.");
                    }
                });
            } // End function - Add document information
            
            // Start - Showing and Hiding of Log rows for Main Document
            jQuery("#viewAllLogs").live("click",function() {
//                jQuery(".mainDocLogRow").each(function(index) {
//                    jQuery(this).show();
//                });
                
                if ( jQuery("#viewAllLogs").html() == "View All" ) {
                    jQuery(".viewAllLogsRow").show();
                    jQuery("#viewAllLogs").html("Hide Logs");
                }
                else {
                    jQuery(".viewAllLogsRow").hide();
                    jQuery(".viewAllLogsAttchRow").hide();
                    jQuery("#viewAllLogs").html("View All");
                }
            }); // End - Showing and Hiding of Log rows for Main Document
            
            // Start - Showing and Hiding of Log rows for Attachment
            jQuery("#viewAllAttchLogs").live("click",function() {
                if ( jQuery("#viewAllAttchLogs").html() == "View All" ) {
                    jQuery(".viewAllAttchLogsRow").show();
                    jQuery("#viewAllAttchLogs").html("Hide Logs");
                }
                else {
                    jQuery(".viewAllAttchLogsRow").hide();
                    jQuery("#viewAllAttchLogs").html("View All");
                }
            }); // End - Showing and Hiding of Log rows for Attachment
            